package com.link2room.jetfire.enums;

import org.apache.commons.lang.StringUtils;

/*
 * 订单类型，PRE预付，CASH现付，CREDIT信用，GROUP团购，FREE免费
 */
public enum ReservationResTypeEnum {

	PRE("PRE", "预付"),CASH("CASH", "现付"),CREDIT("CREDIT", "信用"),GROUP("GROUP", "团购"),FREE("FREE", "免费"),;
	
	private String code;
	private String des;

	private ReservationResTypeEnum(String code, String des) {
		this.code = code;
		this.des = des;
	}
	
	public static String getDesByCode(String code) {
		if(StringUtils.isBlank(code) ) {
			return null;
		}
		for(ReservationResTypeEnum reservationResTypeEnum : ReservationResTypeEnum.values()) {
			if(StringUtils.equals(code, reservationResTypeEnum.getCode())) {
				return reservationResTypeEnum.getDes();
			}
		}
		return null;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDes() {
		return des;
	}

	public void setDes(String des) {
		this.des = des;
	}

}
